<script>
  import $ from 'dfish-widget'
  import Widget from '../Widget.vue'
  import form from '../widget.form.js'
  import input from '../widget.form.input.js'

  export default {
    mixins: [Widget],
    data() {
      return {
        name: 'Switch',
        remark: '开关选项',
        deprecate: 'placeholder',
        extends: [form, input],
        deprecate: 'validate-default',
        attrs: [{
          name: 'checked-text',
          type: 'String',
          remark: '选中状态时的文本'
        }, {
          name: 'unchecked-text',
          type: 'String',
          remark: '未选中状态时的文本'
        }, {
          name: 'checked-value',
          type: 'String',
          remark: '选中状态时的值'
        }, {
          name: 'unchecked-value',
          type: 'String',
          remark: '未选中状态时的值'
        }, {
          name: 'model-value / v-model',
          remark: '表单值。当modelValue等于checked-value时为选中状态',
        }, ],
        examples: [
          {
            remark: '普通用法',
            view: true,
            type: 'html',
            code: `
              <template>
                <w-switch :label="{text: '选项'}" checked-value="1" unchecked-value="0"></w-switch>
              </template>
            `,
          },
          {
            remark: '显示文本',
            view: true,
            type: 'html',
            code: `
              <template>
                <w-switch :label="{text: '选项'}" checked-value="1" unchecked-value="0" checked-text="是" unchecked-text="否"></w-switch>
              </template>
            `,
          }
        ]
      }
    }
  }
</script>

<style>
</style>
